<template>
<span :class="wrapper_name">
  <button v-if="col.btns.FIELDS" class="ui button primary mini" @click.stop.prevent="showFields(col.val)" title="显示该模型绑定的所有字段">{{col.btns.FIELDS}}</button>
  <button v-if="col.btns.MBINDS" class="ui button primary mini" @click.stop.prevent="showMinds(col.val)" title="显示该模型对应的模型绑定">{{col.btns.MBINDS}}</button>
  <button v-if="col.btns.AUTHS" class="ui button primary mini" @click.stop.prevent="showAuths(col.val)" title="显示该模型对应的权限">{{col.btns.AUTHS}}</button>
  <button v-if="col.btns.EXPORTCONF" class="ui button primary mini" @click.stop.prevent="showExportConfs(col.val)" title="显示该模型对应的导出配置">{{col.btns.EXPORTCONF}}</button>
  <button v-if="col.btns.CLEARCACHE" class="ui button primary mini icon circular" @click.stop.prevent="clearCache(col.val)" title="清除该模型下的缓存"><i class="icon icon-qingchu"></i></button>
</span>
</template>
<script type="text/ecmascript-6">
  import tool from 'src/util/tool';
  import util from '_util/index';

  export default {
    data() {
      return {
      }
    },
    methods: {
        showExportConfs(id){
        this.$router.push('/page/list?ctl=Export&mid='+id);
      },
      showFields(id){
        this.$router.push('/page/list?ctl=Attr&bind_mid='+id);
      },
        clearCache(id){
            let url = tool.getApi(this,'Post', 'clearCacheBymid');
            util.http.SR(this, url, {mid:id}, '清除缓存成功！');

      },
      showMinds(id){
        this.$router.push('/page/list?ctl=Mbind&mid='+id);
      },
      showAuths(id){
        this.$router.push('/page/list?ctl=Auth&model_id='+id);
      },
    },
    computed: {
      ctl(){
        return this.$route.query.ctl;
      },
      is_admin(){
        return util.is_admin(this);
      },
    },
    watch: {
    },

    props: ['col','_id','detail_info','wrapper_name'],
    created() {
    },
  }
</script>
<style rel="stylesheet/less" lang="less"></style>
